home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 8568 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.0 KB

  1. Path: metroux.metrobbs.com!news
  2. From: cakirke@metroux.metrobbs.com (Chris Kirke)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Zombies & Daemons
  5. Date: 5 Mar 1996 03:30:56 GMT
  6. Organization: Metropolis BBS
  7. Message-ID: <4hgchg$t34@metroux.metrobbs.com>
  8. References: <3134348F.7526@citenet.net>
  9. NNTP-Posting-Host: metrix.metrobbs.com
  10. Mime-Version: 1.0
  11. X-Newsreader: WinVN 0.93.11
  12.  
  13. In article <3134348F.7526@citenet.net>, oliver@citenet.net says...
  14. >
  15. >I've just finished writting a daemon to handle generating web 
  16. >pages from an Oracle database. When it executes, the parent forks a 
  17. >number of children, all of which are bound to a network port. Each child 
  18. >services requests in order etc. etc. works more or less like an apache 
  19. >httpd...
  20. >
  21. >        The problem is this: when one of the children dies for whatever 
  22. >reason (usually a f*cked OCI call which makes the daemons session 
  23. >unstable), the parent's sigcld handler forks a new child to keep a 
  24. >consistent number of processes running. For some reason, however, the 
  25. >dead child process lingers around as a zombie process ... how do I avoid 
  26. >this?
  27. >
  28. >        Also, does SunOS support copy on write memory pages? And do 
  29. >zombie processes still use system resources?
  30. >
  31. >Later,
  32. >Oliver Lavery
  33.  
  34. I believe the only resource a zombie process uses is a process table 
  35. entry (which is overlaid with some info for a process that waits on it). 
  36. Depending on your implementation, you may have to "wait" on the dead 
  37. child process after trapping this sigcld in order for the system to 
  38. discard the zombie. (You can disable zombie creation by ignoring sigcld 
  39. in the parent process but then you wouldn't be able to sense the child's 
  40. death and create another child)
  41.  
  42. -- 
  43. >-->-->-->-->-->-->-->-->-->-->-->-->-->-->-->-->-->
  44. |                                                  |
  45. |    Chris Kirke - cakirke@metroux.metrobbs.com    |  
  46. |                                                  |
  47. |    the opinions expressed here ..... whatever    |
  48. |                                                  |
  49. <--<--<--<--<--<--<--<--<--<--<--<--<--<--<--<--<--<
  50.  
  51.